package pers.exercise.AdapterPattern;

import java.util.concurrent.Callable;

public class RunnableAdapter implements Runnable {

    private Callable<Long> callable;

    public RunnableAdapter(Callable<Long> callable){
        this.callable = callable;
    }

    @Override
    public void run() {
       try{
           callable.call();
       }catch(Exception e){
           throw new RuntimeException(e);
       }

    }

    public static void main(String args[]){
        Callable<Long> callable = new Task(100);
        Thread thread = new Thread(new RunnableAdapter(callable));
        thread.start();
    }
    
}
